<form name="memberLoginForm" id="member-login-form" action="<?php echo $this->websiteUrl; ?>sys/login/member" method="post">
	<input type="hidden" id="page-to-redirect" name="pageToRedirect" value=""/>
	<p><label for="member-login-inp">{%Login%}</label><input id="member-login-inp" type="text" name="memberLoginName" value=""/></p>
	<p><label for="member-pass-inp">{%Password%}</label><input id="member-pass-inp" type="password" name="memberPassword" value=""/></p>
	<p><input id="member-submit-btn" type="submit" name="memberSubmit" value="{%Sign In%}"/></p>
	<p><a href="javascript:;" onclick="javascript:showHide('member-login-form', 'forgot-password-form');">{%Forgot password%}?</a></p>
</form>
<div id="msg" style="display: none;" onclick="$(this).hide();"></div>
<form name="forgotPasswordForm" id="forgot-password-form" action="javascript:;" method="post" style="display: none;">
	<p><label for="member-email">{%Type your email%}:</label><input id="member-email" type="text" name="memberEmail" value=""/></p>
	<p><input id="member-recover-btn" type="submit" onclick="sendRecoveringLink()" name="memberRecoverSubmit" value="{%Submit%}"/></p>
	<p>&larr;&nbsp;<a href="javascript:;" onclick="showHide('forgot-password-form', 'member-login-form');">{%Go back%}</a></p>
</form>

<script type="text/javascript">
			$('#page-to-redirect').val(document.location);

			function showHide(idToHide, idToShow) {
				$('#' + idToHide).hide();
				$('#' + idToShow).show();
			}

			function sendRecoveringLink() {
				var websiteUrl = $('#hid-main-wsurl').val();
				var email = trim($('#member-email').val());
				if(email && checkMail(email)) {
					$('#msg').ajaxStart(function(){
						$(this).html('Sending mail...');
					});
					$.ajax({
						type: 'post',
						url: websiteUrl + 'sys/backend_ajax/sendrecoveringlink/',
						data: ({
							email : email
						}),
						success: function(response){
							$('#email').val('');
							switch (response) {
								case "success":
									$('#msg').html('The confirmation link was sent to your email. Check it out!');
								break;
								case "email does not exist":
									$('#msg').html("Sorry!  We can't find a member with that email address.");
								break;
								case "error":
									$('#msg').html('Email address is not valid.');
								break;
							}
							$('#msg').show();
						}
					});
				}
				else {
					$('#msg').html('Email is incorrect.');
					$('#msg').show();
				}
			}
</script>